package com.atguigu.mybatisplus.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * @Author: 绝城孤影
 * @Date: 2024/10/3 16:12
 * @Version: v1.0.0
 * @Description: 用户实体类
 **/

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "t_user")
public class User {
	// 程序采用雪花算法， 采用数据库的自增策略：IdType.AUTO
	@TableId(value = "uid", type = IdType.ASSIGN_ID)
	private Long id;
	private String name;
	private Integer age;
	private String email;
	/**
	 * Date 过期属性，一般使用LocalDateTime属性
	 * 自动填充可采用数据库自动设值策略，也可以采用MQ自动填充功能， MetaObjectHandler方法拦截补充数据
	 */
	@TableField(fill = FieldFill.INSERT)
	private LocalDateTime createTime;
	@TableField(fill = FieldFill.INSERT_UPDATE)
	private LocalDateTime updateTime;

	// 逻辑删除标识，默认
	@TableLogic
	@TableField(value = "is_deleted")
	private Integer deleted;
}
